import request from "@/request";


type TUserParams = {
    loginname: string,
    password: string
}
export const userLogin = (params: TUserParams) => {
    return request.post("/user/login", params)
}

export const MsgCode = (params: { tel: string }) => {
    return request.post("/user/dosendmsgcode", params)
}

export const CheckCode = (params: { tel: string, telcode: string }) => {
    return request.post("/user/docheckcode", params)
}

export const UserRegister = (params: { tel: string, password: string }) => {
    return request.post("/user/dofinishregister", params)
}

export const CheckPhone = (params: { tel: string, }) => {
    return request.post("/user/docheckphone", params)
}

export const getSeckillList = (params: {
    count: number;
    limitNum?: number;
}) => {
    return request.get(
        `/pro/seckilllist?count=${params.count}&limitNum=${params.limitNum}`
    );
};

export const getProList = (params: { count: number; limitNum?: number }) => {
    return request.get(
        `/pro/list?count=${params.count}&limitNum=${params.limitNum}`
    );
};

export const getProduceDetail = (params: string) => {
    return request.get(`/pro/detail/${params}`);
};
